﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data.Objects.DataClasses;

namespace MovieRental.EfRepositoryLibrary.Mappers
{
    public interface IEntityModelMapper<TEntity, TKey, TModel, TBase, TObjectContext>
        where TEntity : new()
        where TKey : IEquatable<TKey>
        where TModel : EntityObject, new()
        where TBase : EntityObject
        where TObjectContext : ObjectContext
    {
        void Convert(TEntity entity, TModel model);
        TModel Convert(TEntity entity);
        TEntity ConvertBack(TModel model);
        void ConvertBack(TModel model, TEntity entity);
        TKey SelectKey(TModel model);
        TKey SelectKey(TEntity entity);
        IQueryable<TModel> SelectObjectQuery(TObjectContext context);
        ObjectSet<TBase> SelectObjectSet(TObjectContext context);
    }
}
